Skip to content

fix(test): hide passwords in --video captions - #7

Open
SaqlainRashed wants to merge 1 commit into
xcodebeast:mainfrom
SaqlainRashed:video-mask-password-captions
Open

SaqlainRashed wants to merge 1 commit into
xcodebeast:mainfrom
SaqlainRashed:video-mask-password-captions

Conversation

@SaqlainRashed

Copy link
Copy Markdown

Summary

  • Captions of --video showed the text tests type, passwords included, and videos get shared.
  • Typing into input[type=password], or an input with autocomplete="current-password" / "new-password", is now captioned as eight dots, whatever the password's length. The server checks the target for fill, type/pressSequentially, keyboard.type and keyboard.insertText, only while a video follows the actions; the result travels on the existing screencastInputAction event as secret.
  • Opt out with narratedVideo: { showPasswords: true }. Documented in docs/videos.md, the TestConfig reference and the README.

Tests

  • Masked caption cases in "captions say what is typed".
  • New end-to-end test: typing into password fields (label-targeted fill, pressSequentially into autocomplete="new-password", keyboard.type / insertText) is recorded as secret, other fields are not.
  • npm run ttest -- flashwright-narrated-video --workers=1: 19 passed, 2 skipped (Linux-only voice tests). npm run flint clean.

Known limits

  • The temporary recording.json still holds the raw value; masking happens when the video is drawn, which is what lets showPasswords apply afterwards. The folder is deleted after rendering unless FLASHWRIGHT_KEEP_VIDEO_WORK is set. Happy to mask at record time instead if you prefer.
  • keyboard.type inside a child frame is not detected (main frame and shadow roots only).

Captions of narrated videos showed the text that tests type, passwords
included, and videos get shared. Typing into an input of type password,
or with autocomplete="current-password" or "new-password", is now
captioned as eight dots, whatever the password's length. The server
checks the target only for fill, type, keyboard.type and
keyboard.insertText, and only while a video follows the actions.

narratedVideo.showPasswords: true shows the typed text again.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant